import axios from 'axios'

const _axios=axios.create({timeout:100000,baseURL:"https://m1.apifoxmock.com/m1/6731094-6442317-default"});
_axios.interceptors.request.use(
    function(config){
       let ss=sessionStorage.getItem('curUser');
       if(ss){
          let user=JSON.parse(ss)
          config.headers.Authorization=user.token;
       }
       return config;
    }
);

_axios.interceptors.response.use(
    (response)=>{return response}
    ,(error)=>{
        console.log(error);
        alert(error)
    }
)

export default _axios;